{extend name="public/base"/}
{block name="style"}
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
{/block}
{block name="body"}
<div class="main-box no-header clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>{$meta_title}</h2>
		</div>
		<div class="pull-right">
			<a class="btn btn-success" href="{:url('addad?id='.$id)}"><i class="fa fa-plus-circle fa-lg"></i> 新 增</a>
			<a class="btn btn-primary" href="{:url('index')}"><i class="fa fa-list fa-lg"></i> 广告位</a>
		</div>
	</header>
	<div class="main-box-body clearfix">
		<!-- 表格列表 -->
		<div class="table-responsive clearfix">
			<table class="table table-hover">
				<thead>
					<tr>
						<th width="60">ID</th>
						<th width="120">标题</th>
						<th width="120">图片</th>
                                                <th width="120">链接地址</th>
                                                <th width="120">广告状态</th>
						<th width="120">更新时间</th>
                                                <th width='80'>排序</th>
						<th width="80">操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name="list" id="item"}
					<tr>
						<td>{$item['id']}</td>
						<td>{$item['title']}</td>
                                                
                                                <?php if($item['cover_id']){ ?>
                                                <td><img src="{$item.cover_id|getPicUrl}" width="192" height="108"></td>
                                                <td>
                                                    {$item.url}
                                                </td>
                                                <?php }else if($item['photolist']){ ?>
                                                <td><img src="{$item.photolist|getPicUrl}" width="192" height="108"></td>
                                                <td>
                                                    {$item.listurl}
                                                </td>
                                                <?php }else{ ?>       
                                                    <td>no image</td>
                                                    <td>
                                                        {$item.url}
                                                    </td>                                                
                                                <?php } ?>  
                                                <td>
                                                    <?php if($item['status']==1){ ?>
                                                      启用
                                                    <?php }else if($item['status']==0){ ?>
                                                      禁用
                                                    <?php } ?>
                                                </td>
						<td>{$item['update_time']|date='Y-m-d H:i',###}</td>
                                                <td>{$item.sort}</td>
						<td>
							<a href="{:url('editad?id='.$item['id'])}">编辑</a>
							<a href="{:url('delad?id='.$item['id'])}" class="confirm ajax-get">删除</a>
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
		</div>
		<!-- /表格列表 -->
	</div>
</div>
{/block}